package co.msk8.shared.states;

import co.msk8.client.command.Result;
import co.msk8.client.command.result.SumResult;
import co.msk8.client.visual.calculator.presenter.CalculatorPresenterImpl;

public class ResultOperationState implements OperationState {

	private CalculatorPresenterImpl stateManager;

	public ResultOperationState(CalculatorPresenterImpl calculatorPresenterImpl) {
		this.stateManager = calculatorPresenterImpl;
	}

	public void addDigit(String digit) {
		// TODO Auto-generated method stub

	}

	public void addOperator(String operator) {
		// TODO Auto-generated method stub

	}

	public void removeLast() {
		// TODO Auto-generated method stub
		
	}


	public void setResult(Result result) {
		if (result instanceof SumResult) {
			SumResult sumResult = (SumResult) result;
			stateManager.setResult(sumResult.getSum());
		}
		stateManager.writeOperationOnDisplay();
	}

}
